﻿<UserControl x:Class="HackingSilverlightDotNet.CustomControls.IconImageButton"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    > 
    <Canvas x:Name="LayoutRoot" >
        <Canvas.Triggers>
            <EventTrigger RoutedEvent="Grid.Loaded">
                <EventTrigger.Actions>
                    <BeginStoryboard>
                        <Storyboard Storyboard.TargetName="ImageElement">
                            <DoubleAnimation Storyboard.TargetProperty="(Canvas.Left)" From="-500"  To="0" Duration="0:0:1" >
                                <DoubleAnimation.EasingFunction>
                                    <BounceEase Bounces="10" EasingMode="EaseIn" Bounciness="10" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
        </Canvas.Triggers>
        <Image x:Name="ImageElementBack" Width="18" Height="18" Cursor="Hand" Visibility="Collapsed"
               MouseEnter="Image_MouseEnter" 
               MouseLeave="Image_MouseLeave" 
               MouseLeftButtonDown="Image_MouseLeftButtonDown" 
               MouseLeftButtonUp="Image_MouseLeftButtonUp" >
            <Image.Effect>
                <DropShadowEffect x:Name="ImageDropShadow1" ShadowDepth="5" Opacity=".7"/>
            </Image.Effect>
        </Image>
        <Image x:Name="ImageElement" Width="18" Height="18" Cursor="Hand" 
               MouseEnter="Image_MouseEnter" 
               MouseLeave="Image_MouseLeave" 
               MouseLeftButtonDown="Image_MouseLeftButtonDown" 
               MouseLeftButtonUp="Image_MouseLeftButtonUp" >
            <Image.Effect>
                <DropShadowEffect x:Name="ImageDropShadow2" ShadowDepth="5" Opacity=".7"/>
            </Image.Effect>
        </Image>
    </Canvas>
</UserControl>
